<?php
namespace App\Weixin;

/**
 * Created by PhpStorm.
 * User: zxd
 * Date: 2016/10/19 0019
 * Time: 下午 6:20
 */
class WeixinUtils
{
    const WX_POSITION_HOME = "home";
    const WX_POSITION_ABOUT = "about";
    const WX_POSITION_BRANCHES = "branches";
    const WX_POSITION_SPECIALTIES = "specialties";
    const WX_POSITION_CONTACT_US = "contact_us";
    const WX_POSITION_TEAM = "team";
    const WX_POSITION_SETTINGS = "settings";

    static public function getWeixinUrl($companyId, $toUser, $nextUrl = "")
    {
        return env("WX_SITE_ROOT") . "pages/system/quick_login.php?cid=$companyId&openId=$toUser&nextUrl=$nextUrl";
    }
    static public function getTeacherWeixinUrl($companyId, $toUser, $nextUrl = "")
    {
        return env("TEACHER_WX_SITE_ROOT") . "pages/system/quick_login.php?cid=$companyId&openId=$toUser&nextUrl=$nextUrl";
    }

    static public function getWxSiteRoot($appFlag)
    {
        if ($appFlag == "tz") {
            return "http://tz.wx.xmanju.cn/";
        }
        return "http://wx.xmanju.cn/";
    }
}